package com.mcxx.modules.miniSalvation.fundpay.service.read;

import com.mcxx.modules.miniSalvation.fundpay.dao.read.FundpayExceptionReadDao;
import com.mcxx.modules.miniSalvation.fundpay.dto.FundpayExceptionDTO;
import com.mcxx.modules.miniSalvation.fundpay.entity.FundpayExceptionEntity;
import com.yinhai.ta404.core.restservice.requestbean.PageParam;
import com.yinhai.ta404.core.restservice.resultbean.Page;
import com.yinhai.ta404.core.service.BaseService;
import com.yinhai.ta404.core.transaction.annotation.TaTransactional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("singlefundPayExceptionReadService")
@TaTransactional(readOnly = true)
public class SingleFundPayExceptionReadService extends BaseService{

    @Autowired
    private FundpayExceptionReadDao fundpayExceptionReadDao;


    public List<FundpayExceptionEntity> listAll() {
        return fundpayExceptionReadDao.listAll();
    }



    public FundpayExceptionEntity getById(String id) {
        return fundpayExceptionReadDao.getById(id);
    }


    public List<FundpayExceptionEntity> getExceptionByFundpayId(String fundpayId) {
        return fundpayExceptionReadDao.selectExceptionByFundpayId(fundpayId);
    }


    public Page<FundpayExceptionEntity> getPageExceptionByFundpayId(String fundpayId, PageParam pageParam) {
        fundpayExceptionReadDao.beginPager(pageParam);
        List<FundpayExceptionEntity> list = fundpayExceptionReadDao.selectExceptionByFundpayId(fundpayId);
        return fundpayExceptionReadDao.endPager(list);
    }


    public List<String> getExceptionIdByFundpayId(String fundpayId) {
        return fundpayExceptionReadDao.selectExceptionIdByFundpayId(fundpayId);
    }


    public Page<FundpayExceptionEntity> getExceptionIdByTempFundpayId(String fundpayId, PageParam pageParam) {
        fundpayExceptionReadDao.beginPager(pageParam);
        List<FundpayExceptionEntity> list =  fundpayExceptionReadDao.selectExceptionByTempFundpayId(fundpayId);
        return fundpayExceptionReadDao.endPager(list);
    }


    public List<FundpayExceptionDTO> getExceptionByIDAndFundpayId(String fundpayId, List<String> exceptionIdList) {
        return fundpayExceptionReadDao.selectExceptionByIDAndFundpayId(fundpayId, exceptionIdList);
    }



    public List<FundpayExceptionDTO> getTempExceptionByIDAndFundpayId(String fundpayId, List<String> exceptionIdList) {
        return fundpayExceptionReadDao.selectTempExceptionByIDAndFundpayId(fundpayId, exceptionIdList);
    }
}
